My task?

Make finalized map(s) in which I:

Do you want your maps to be static or interactive? What areas do you want to focus on? Do you want to show land use/landcover and watersheds in a single map or in separate maps? Just make sure that your final outputs are presented in a nice professional HTML that you’d be proud to share with someone so that they can see your awesome spatial code!

Let’s get cracking!

Read in data

water <- read_sf(here("Watersheds", "Watersheds.shp"))

Basically plot it

plot(water)

Unfortunately, swma (water management area) doesn’t look very interesting… “wuc” (watershed unit code text) and “huc” (watershed unit code numeric) also don’t look too interesting

Check on other map related things and map it!

st_crs(water) #cool, EPSG is 4326, as it should be
## Coordinate Reference System:
##   EPSG: 4326 
##   proj4string: "+proj=longlat +datum=WGS84 +no_defs"
#Rename variable of interest in the name of good-looking maps
water <- water %>% 
  mutate(`Watershed Area (sq m)`= hucarea)

water_map <- ggplot(data=water) +
  geom_sf(aes(fill=`Watershed Area (sq m)`), show.legend = FALSE, size=0.1) +
  scale_fill_paletteer_c("scico::hawaii", direction=-1) +
  ggtitle("Watersheds of the Hawaiian Islands") +
  xlab("Longitude") +
  ylab("Latitude") +
  theme(panel.grid.major = element_line(color = "gray"(0.5), linetype = "dashed", size = 0.5),
        panel.background = element_rect(fill = "aliceblue"))

ggplotly(water_map) %>%
  highlight(
    "plotly_hover",
    selected = attrs_selected(line = list(color = "black")))

This plot allows us to zoom in to each of the islands. But maybe proof of concept? Next, let’s zoom in on just the main island

library(scales)

ggplot(data=water) +
  geom_sf(aes(fill=`Watershed Area (sq m)`), size=0.1) +
  scale_fill_paletteer_c("scico::hawaii", direction=-1, label=comma) +
  coord_sf(xlim=c(-156.5, -154.5), ylim=c(18.7, 20.4)) + #zoom into big island
  annotation_scale(location = "br", width_hint = 0.3) + #add a scale bar
  annotation_north_arrow(location = "br", which_north = "true",
                         pad_x = unit(0.3,"in"), pad_y = unit(0.3, "in"),
                         style = north_arrow_fancy_orienteering) +
  ggtitle("Watersheds of Hawaii, HI") +
  xlab("Longitude") +
  ylab("Latitude") +
  theme(panel.grid.major = element_line(color = "gray"(0.5), linetype = "dashed", size = 0.5),
        panel.background = element_rect(fill = "aliceblue"))